package edu.uwlax.cs.oayonlinestore.client.gui.salesdept;

import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.HorizontalPanel;
import com.google.gwt.user.client.ui.VerticalPanel;
import com.google.gwt.user.client.ui.Widget;

import edu.uwlax.cs.oayonlinestore.client.gui.shared.ProductTree;
import edu.uwlax.cs.oayonlinestore.client.utils.StackPage;
import edu.uwlax.cs.oayonlinestore.client.utils.StackPanel;
import edu.uwlax.cs.oayonlinestore.client.utils.VSpacer;

public class PageSalEditPrices extends StackPage {

	public class PricePanel extends StackPanel {

		private PageSalSubcatPrices prices = new PageSalSubcatPrices();

		public PricePanel(StackPage parent) {
			super(parent);
			add(prices);
		}

	}

	private PricePanel frame = new PricePanel(this);

	protected void create() {
		HorizontalPanel p = new HorizontalPanel();
		frame.setWidth("100%");
		frame.init();
		p.add(createLeft());
		p.add(new VSpacer("32px"));
		p.add(frame);
		setWidget(p);
	}

	private Widget createLeft() {
		VerticalPanel panel = new VerticalPanel();
		panel.add(new HTML("<b>Products</b>"));
		panel.add(new ProductTree(null, frame.prices));
		return panel;
	}

	public String getID() {
		return "Prices";
	}

	protected boolean onShow(String param) {
		frame.onHistoryChanged(param);
		return true;
	}
}
